package com.class05.advice;

import org.aspectj.lang.annotation.*;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Order(2)
public class TestB {

    @Before("execution(* com.class05.service.*.mul(..))")
    public void pre(){
        System.out.println("TestB前置通知");
    }


    @AfterReturning(value = "execution(* com.class05.service.*.mul(..))",returning="result")
    public void afterReturning(int result){
        System.out.println("TestB结果：" + result);
        System.out.println("TestB返回通知");
    }

    @After("execution(* com.class05.service.*.mul(..))")
    public void after(){
        System.out.println("TestB后置通知");
    }

    @AfterThrowing("execution(* com.class05.service.*.mul(..))")
    public void afterThrowing(){
        System.out.println("TestB异常通知");
    }
}
